package com.fll.user.service;

import com.fll.thrift.user.IUserService;
import com.fll.thrift.user.UserInfo;
import com.fll.user.mapper.UserMapper;
import org.apache.thrift.TException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author fanlei
 * @Version 1.0
 * @Date 2018年09月01日
 */
@Service
public class UserServiceImpl implements IUserService.Iface {

    @Autowired
    private UserMapper userMapper;


    @Override
    public UserInfo getUserById(int id) throws TException {
        return userMapper.getUserById(id);
    }

    @Override
    public UserInfo getUserByName(String userName) throws TException {
        return userMapper.getUserByName(userName);
    }

    @Override
    public void regiserUser(UserInfo userInfo) throws TException {
        userMapper.registerUser(userInfo);
    }

    @Override
    public UserInfo getTeacherById(int id) throws TException {
        return userMapper.getTeacherById(id);
    }
}
